package zxj.spay.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Table(name="stream")
@Entity
public class Stream implements Serializable{
	private static final long serialVersionUID = -8396689884896365231L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int id;
	
	@JoinColumn(name="user_id",referencedColumnName="id")
	@ManyToOne(fetch=FetchType.LAZY)
	private User user;
	
	/**
	 * 创建时间，这个时间是记录生成的时间
	 */
	@Column(nullable=false)
	private Date createTime;
	/**
	 * 订单使用时间，这个时间是金额产生的时间
	 */
	@Column(nullable=false)
	private Date useTime;
	
	/**
	 * 收支描述
	 */
	private String description;
	
	/**
	 * 金额，单位：分
	 */
	private int money;
	
	
	/**
	 * 收支类型
	 */
	@JoinColumn(name="type_id",referencedColumnName="id")
	@ManyToOne(fetch=FetchType.LAZY)
	private Type type;


	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}


	public User getUser() {
		return user;
	}


	public void setUser(User user) {
		this.user = user;
	}


	public Date getCreateTime() {
		return createTime;
	}


	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}


	public Date getUseTime() {
		return useTime;
	}


	public void setUseTime(Date useTime) {
		this.useTime = useTime;
	}

	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public int getMoney() {
		return money;
	}


	public void setMoney(int money) {
		this.money = money;
	}


	public Type getType() {
		return type;
	}


	public void setType(Type type) {
		this.type = type;
	}
	
	
}
